package com.taoym.voucher.common.enums;

import lombok.Getter;
/**
 * @author: taoym
 * @date: 2020/5/11 11:06
 * @desc: 图片格式
 */
@Getter
public enum  ImageSuffixEnum {
    BMP(".BMP"),
    JPG(".JPG"),
    JPEG(".JPEG"),
    PNG(".PNG"),
    GIF(".GIF"),
    ;

    private final String code;

    ImageSuffixEnum(String code){
        this.code = code;
    }

    public static boolean getImageSuffix(String code){
        for (ImageSuffixEnum imageSuffixEnum:values()){
            if(code.equalsIgnoreCase(imageSuffixEnum.getCode())){
                return true;
            }
        }
        return false;
    }
}
